package com.angis.fx.activity.search;

import android.app.ActivityGroup;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

import com.angis.fx.activity.R;
import com.angis.fx.data.ChangsuoInformation;

public class ChangsuoDetailsTab extends ActivityGroup {
    public static TabHost tab_host;
    
    private ChangsuoInformation mChangsuoInfo;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.bottomtab);
        
        mChangsuoInfo = (ChangsuoInformation)getIntent().getExtras().get("selectedcs");
        

        tab_host = (TabHost) findViewById(R.id.changsuodetailstab);
        tab_host.setup(this.getLocalActivityManager());
        
        TabSpec ts1 = tab_host.newTabSpec("details"); 
        ts1.setIndicator("详细信息"); 
        Intent lDetailsIntent = new Intent(this, ChangsuoDetailsActivity.class);
        lDetailsIntent.putExtra("selectedcs", mChangsuoInfo);
        ts1.setContent(lDetailsIntent); 
        tab_host.addTab(ts1); 

        TabSpec ts2 = tab_host.newTabSpec("postion"); 
        ts2.setIndicator("位置"); 
        Intent lPositionIntent = new Intent(this, ChangsuoPositionActivity.class);
        lPositionIntent.putExtra("selectedcs", mChangsuoInfo);
        ts2.setContent(lPositionIntent); 
        tab_host.addTab(ts2); 

        TabSpec ts3 = tab_host.newTabSpec("picture"); 
        ts3.setIndicator("照片"); 
        Intent lPictureIntent = new Intent(this, ChangsuoPictureActivity.class);
        lPictureIntent.putExtra("selectedcs", mChangsuoInfo);
        ts3.setContent(lPictureIntent); 
        tab_host.addTab(ts3); 
        
        TabSpec ts4 = tab_host.newTabSpec("checkinfo"); 
        ts4.setIndicator("巡查信息"); 
        Intent lCheckInfoIntent = new Intent(this, CheckInfoActivity.class);
        lCheckInfoIntent.putExtra("selectedcs", mChangsuoInfo);
        ts4.setContent(lCheckInfoIntent); 
        tab_host.addTab(ts4); 
        
        TabSpec ts5 = tab_host.newTabSpec("punishment"); 
        ts5.setIndicator("行政检查"); 
        Intent lPunishmentIntent = new Intent(this, PunishmentActivity.class);
        lPunishmentIntent.putExtra("selectedcs", mChangsuoInfo);
        ts5.setContent(lPunishmentIntent); 
        tab_host.addTab(ts5); 
        
        tab_host.getTabWidget().getChildAt(0).getLayoutParams().height = 40;
        tab_host.getTabWidget().getChildAt(1).getLayoutParams().height = 40;
        tab_host.getTabWidget().getChildAt(2).getLayoutParams().height = 40;
        tab_host.getTabWidget().getChildAt(3).getLayoutParams().height = 40;
        tab_host.getTabWidget().getChildAt(4).getLayoutParams().height = 40;

        tab_host.setCurrentTab(0);
    }
}


